#version 330 core

in DATA
{
    vec2 pos;
    vec2 center;
    vec2 radius;
    vec4 color;
} fs_in;

out vec4 FragColor;

void main()
{
    vec2 dist = fs_in.pos - fs_in.center;
    float distSquared = (dist.x / fs_in.radius.x) * (dist.x / fs_in.radius.x) + 
                    (dist.y / fs_in.radius.y) * (dist.y / fs_in.radius.y);
    if (distSquared >= 1)
        discard;
    FragColor = fs_in.color;
}
